<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style type="text/css">
        .father {
            width: 400px;
            height: 400px;
            background-color: pink;
        }

        .son {
            /*子绝父相-子级绝对定位， 父级相对定位*/
            position: relative;
            width: 300px;
            height: 300px;
            background-color: skyblue;
        }

        .grandson {
            position: absolute;
            left: 30px;
            top: 20px;
            width: 200px;
            height: 200px;
            background-color: green;
        }
        /*绝对定位查找父级定位的方式：逐层向上查找父级定位，没有找到使用浏览器窗口为参照定位*/
    </style>
</head>
<body>
<div class="father">
    <div class="son">
        <div class="grandson"></div>
    </div>
</div>
</body>
</html>